#include "Classifier.h"

#include "Classifier_Randomize.h"
#include "Classifier/KNN/KNN.h"
#include "Classifier/KNN/KNNPP.h"
#include "Classifier/LIBSVM/LibSVM.h"

#include <iostream>

using namespace std;

Classifier::Classifier(void)
{
}

Classifier::~Classifier(void)
{
}

Classifier* Classifier::newInstance(IN STRING _insName, IN MemoryManager* _memM)
{
    if (_insName == Classifier_Randomize::insName())
    {
        Classifier_Randomize* ret = _memM->newT(ret);
        return ret;
    }
    else if (_insName == KNN::insName())
    {
        KNN* ret = _memM->newT(ret);
        return ret;
    }
    else if (_insName == KNNPP::insName())
    {
        KNNPP* ret = _memM->newT(ret);
        return ret;
    }
    else if (_insName == LibSVM::insName())
    {
        LibSVM* ret = _memM->newT(ret);
        return ret;
    }
    //TODO
}

VOID Classifier::deleteInstance(INOUT VOID* _ptr, IN STRING _insName, IN MemoryManager* _memM)
{
    if (_insName == Classifier_Randomize::insName())
    {
        _memM->deleteT((Classifier_Randomize*)_ptr);
    }
    else if (_insName == KNN::insName())
    {
        _memM->deleteT((KNN*)_ptr);
    }
    else if (_insName == KNNPP::insName())
    {
        _memM->deleteT((KNNPP*)_ptr);
    }
    else if (_insName == LibSVM::insName())
    {
        _memM->deleteT((LibSVM*)_ptr);
    }
    //TODO
}

VOID Classifier::regLogger(IN Logger* _logger)
{
    m_Logger = _logger;
}

VOID Classifier::regMemoryManager(IN MemoryManager* _memM)
{
    m_MemManager = _memM;
}

VOID Classifier::regOptions(IN Options* _opt)
{
    m_Options = _opt;
}